import request from '@/utils/request'

// 获取wms转库单
export function getTransferOrdersInfo(query) {
  return request({
    url: '/transfer-orders',
    method: 'get',
    params: query
  });
}

// 获取NCC转库单
export function getTransferOrdersNccInfo(query) {
  return request({
    url: '/transfer-orders/ncc',
    method: 'get',
    params: query
  });
}

// +++废除转库单
export function deleteTransferOrders(cspecialhid, query) {
  return request({
    url: `/transfer-orders/${cspecialhid}`,
    method: 'DELETE',
    params: query
  });
}

// 对NCC转库单进行签字
export function updateTransferOrders(vbillcode, data) {
  return request({
    url: `/transfer-orders/${vbillcode}`,
    method: 'PUT',
    data
  });
}

// 修改NCC转库出库单
export function createTransferOrdersUpdate(data) {
  return request({
    url: '/transfer-orders/update',
    method: 'post',
    data: JSON.stringify(data) // 将传入的数据转换为JSON字符串后作为请求体发送
  });
}

// 新增NCC转库出库单
export function createTransferOrders(data) {
  return request({
    url: '/transfer-orders',
    method: 'post',
    data: JSON.stringify(data) // 将传入的数据转换为JSON字符串后作为请求体发送
  });
}

// WMS确认NCC转库单
export function createTransferOrdersConfirm(data) {
  return request({
    url: '/transfer-orders/confirm',
    method: 'post',
    data: JSON.stringify(data) // 将传入的数据转换为JSON字符串后作为请求体发送
  });
}

// 转库移库取消提取
export function createTransferOrdersBack(headerid) {
  return request({
    url: `/transfer-orders/back/${headerid}`,
    method: 'post',
  });
}

// 转库移库WMS下账
export function createTransferOrdersInventory(headerid) {
  return request({
    url: `/transfer-orders/inventory/${headerid}`,
    method: 'post',
  });
}